package net.tw.transactional2.controller;

import net.tw.transactional2.annotation.Transactional2;
import net.tw.transactional2.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/person")
public class PersonController {

    @Autowired
    PersonService personService;

    @Transactional2
    @RequestMapping("/name")
    public ResponseEntity<Object> name() {
        return ResponseEntity.ok().body(personService.setName());
    }
}
